<template>
  <div class="bg">
    <nav-com
      :title="$t('yongjinguize')"
      :showView='showView'
      @back="backHandler()"
    ></nav-com>
    <div class="top-view1 main-page-wrapper">
      <!-- 两端对齐 -->
      <van-row type="flex" justify="space-between" class="top-title" align="center">
        <van-col span="18">
          <div class="title">{{$t('yongjin') + '：'+ userdata.commission}}</div>
<!--          <div class="sub-title">{{ $t('yongjin') + '：'+ userdata.medalLevel.level_text }}</div>-->
        </van-col>
        <van-col span="6" style="display: flex;align-items: center;justify-content: center">
<!--          <img class="right-img" :src="userdata.medalLevel.level_icon?userdata.medalLevel.level_icon:require('../../assets/userInfo/xunzhang@2x.png')" alt="">-->
        </van-col>
      </van-row>
      <van-cell-group inset class="teshu m-l-0">
        <div class="wenti" v-html="userdata.bonustxt"></div>
        <!--          <div class="quanyicontent">{{ userdata.medal.medalcontent }}</div>-->
      </van-cell-group>
    </div>
  </div>
</template>
<script>
import navCom from "@/components/nav-com-new.vue";
import {bonus} from "../../api/user";
export default {
  name: "bonusList",
  components: {
    navCom,
  },
  data() {
    return {
      showView: true,
      userdata:{},
      title: "勋章",
    };
  },
  mounted() {
    this.init();
  },
  methods: {
    jumpTo(url,canshu){
      this.$router.push({path: url,
        query: {canshu:canshu}
      })
    },
    //返回
    backHandler() {
      const nav = navigator.userAgent;
      if (nav.indexOf('Android') > -1 || nav.indexOf('Adr') > -1) {
        phone.onBackPress();
      } else if (!!nav.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
        this.$bridge.callhandler('onBackPress', {}, res => {});
      }else{
        this.$router.go(-1);
      }
    },
    //初始化
    init() {
      this.onSearch()
    },
    onSearch(){
      bonus().then((res)=>{
        if(res.code==1){
          this.userdata = res.data;
        }
      })
    }
  },
};
</script>
<style lang="scss" scoped>
.top-view1{
  margin-top: 23.23vw;
  overflow-x: hidden;
}
.bg{
  background: url(../../assets/helpRobot/juxing@2x.png) no-repeat #ffffff;
  background-size: 100%;
}
.m-b-10{
  margin-bottom: 10px;
}
.m-t-10{
  margin-top: 10px;
}
.van-cell__title, .van-cell__value {
  flex: 1;
  display: flex;
  align-items: center;
}
.teshu{
  min-height: 60vh;
}
.m-l-0{
  margin:20px 0  0!important;
}
.search_btn{
  width: 56px;
  background: linear-gradient(90deg, #1ED6C2 0%, #00DEA1 100%);
  color:#fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.van-search__action{
  padding-left: 0;
}
.top-title{
  color: #fff;
  .title{
    padding: 0rem 0rem 0px 0.42667rem;
    font-size: 22px;
    font-family:PingFang, PingFangSC-Semibold, PingFang SC;
    font-weight: 600;
    text-overflow: ellipsis; //文本超出块元素时以省略号的形式显示
    overflow: hidden;
    white-space: nowrap; //规定段落中的文本不进行换行
  }
  .sub-title{
    padding: 0rem 0rem 0px 0.42667rem;
    font-size: 16px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    margin-top: 10px;
    text-overflow: ellipsis; //文本超出块元素时以省略号的形式显示
    overflow: hidden;
    white-space: nowrap; //规定段落中的文本不进行换行
  }
  .right-img{
    width: 80px;
  }
}
.wenti{
  font-size: 22px;
  font-family: PingFangSC-Semibold, PingFang SC;
  font-weight: 600;
  color: #303030;
  margin: 0px 0.42667rem;
  padding: 15px 0 15px;
}
.quanyicontent{
  font-size: 18px;
  color: #303030;
  margin: 0px 0.42667rem;
  padding: 10px 0 15px;
}
</style>
